package com.example.test1;

public class test2 {
    String name;
    int age;
    String className;
    String stuId; //成员变量
//    局部变量
    test2 (String name,int age,String className,String stuId){
        this.name = name;
        this.age = age;
        this.stuId = stuId;
        this.className = className;
    };
    void study(){
        System.out.println(name+"正在学习...");
    };
    void sayHi(){
        System.out.println("大家好，我叫"+name+",我今年"+age+"岁了，我在"+className+"班，学号为"+stuId);
    };
    void playWith(String authorName){
        System.out.println(name+"正在和"+authorName+"一起玩");
    };
}
